package tchk.xyz.lingyuntutorminiprogram.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tchk.xyz.lingyuntutorminiprogram.entity.SysPermission;

import java.util.List;

@Mapper
public interface SysPermissionMapper extends BaseMapper<SysPermission> {

    /**
     * 根据用户ID查询该用户拥有的所有权限标识符
     *
     * @param userId 用户ID
     * @return 权限标识符列表 (e.g., ["admin:teacher:audit", "admin:user:manage"])
     */
    List<String> findPermissionCodesByUserId(@Param("userId") Long userId);
}